<template>
  <div class="container">
    <CustomTable ref="listRef" :condition="cdns" :columns="cols" titleIcon="icon-settings" :actions="actions" :dialogConfig="dialogConfig" isCreate tableTitle="账户管理">
      <template #is_super="{ row }">
        <a-tag :color="row.is_super === 1 ? '#00b42a' : '#86909c'">{{ row.is_super === 1 ? '是' : '否' }}</a-tag>
      </template>
      <template #is_disable="{ row }">
        <a-tag :color="row.is_disable === 1 ? '#00b42a' : '#86909c'">{{ row.is_disable === 1 ? '是' : '否' }}</a-tag>
      </template>
    </CustomTable>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from "vue";
import CustomTable from "@/components/custom-list/index.vue";
import { initUniTypeFilter } from "@/utils/utils";
import { useConditions, useColumns, useActions, useDialogConfig } from "./cfg";

export default defineComponent({
  path: "user", // 导航路由地址
  name: "User",
  locale: "账户管理", // 导航名称
  permissions: [], // 权限数组
  components: { CustomTable },
  setup(props, ctx) {
    const cdns = useConditions();
    const cols = useColumns();
    const actions = useActions();
    const dialogConfig = useDialogConfig();
    const listRef = ref(null);
    const uniTypeFilter = initUniTypeFilter(cdns).uniTypeFilter;

    return {
      cdns,
      cols,
      actions,
      dialogConfig,
      uniTypeFilter,
      listRef,
    };
  },
});
</script>

<style></style>
